package com.example.devicemanage.dao;

import com.example.devicemanage.entity.Break;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BreakMapper {
    @Insert("INSERT INTO break (eid,date,note) VALUES (#{0},#{1},#{2})")
    int insertBreak(String eid, String date, String note);

    @Select("SELECT * FROM break")
    List<Break> showAllBreak();

    @Delete("DELETE FROM break WHERE bid=#{repairid}")
    int deleteById(int repairid);

    @Insert("INSERT INTO break (bid,eid,date,note) VALUES (#{bid},#{eid},#{date},#{note})")
    int updateBreak(Break b);
}
